package com.yxq.mdt.app.modules.socialcontact.adapter;


import android.net.Uri;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.chad.library.adapter.base.BaseMultiItemQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.yxq.mdt.app.R;
import com.yxq.mdt.app.glide.GlideHelper;
import com.yxq.mdt.app.modules.bean.UploadImageBean;

import java.io.File;
import java.util.List;

import cn.jzvd.Jzvd;
import cn.jzvd.JzvdStd;

/**
 * @author L
 * @time 2019-11-07
 * @describe 视频上传选择器$
 */
public class PublishVideoListAdapter extends BaseMultiItemQuickAdapter<UploadImageBean, BaseViewHolder> {


    public PublishVideoListAdapter(List<UploadImageBean> data) {
        super(data);
        addItemType(-1, R.layout.layout_item_selector_image);
        addItemType(0, R.layout.layout_item_selector_video_publish);
    }

    @Override
    protected void convert(BaseViewHolder helper, UploadImageBean item) {
        switch (item.getItemType()) {
            case -1:
                break;
            case 0:
                ImageView imageView = helper.getView(R.id.iv_video);
                GlideHelper.setLoadRoundImage(mContext, String.valueOf(Uri.fromFile(new File(item.getPath()))), R.color.gray, imageView);
                helper.addOnClickListener(R.id.iv_delete);
                break;
        }

    }
}
